import { BasicColumn, FormSchema } from '/@/components/Table';

export const Permission = {
  ADD: 'dict.detail.add',
  EDIT: 'dict.detail.edit',
  DEL: 'dict.detail.del',
};

export const columns: BasicColumn[] = [
  {
    title: '标题',
    dataIndex: 'title',
  },
  {
    title: '编号',
    dataIndex: 'code',
  },
  {
    title: '值',
    dataIndex: 'value',
  },
  {
    title: '备注',
    dataIndex: 'remark',
  },
];

export const formSchema: FormSchema[] = [
  {
    field: 'title',
    label: '标题',
    component: 'Input',
    rules: [
      { required: true, message: '请填写标题' },
      { max: 100, message: '标题最多100字' },
    ],
  },
  {
    field: 'code',
    label: '编号',
    component: 'Input',
    rules: [
      { required: true, message: '请填写编号' },
      { max: 100, message: '编号最多100字' },
    ],
  },
  {
    field: 'value',
    label: '值',
    component: 'InputTextArea',
    rules: [
      { required: true, message: '请填写值' },
      { max: 255, message: '值最多255字' },
    ],
  },
  {
    field: 'remark',
    label: '备注',
    component: 'InputTextArea',
    rules: [{ max: 255, message: '编号最多255字' }],
  },
];
